package com.coocaa.app.lib.cleaner.deleter.pkgdata;

import android.content.Context;

import com.coocaa.app.lib.cleaner.deleter.AbstractDeleter;
import com.coocaa.app.lib.cleaner.deleter.pkgdata.impl.PackageDataDeleterImpl2;
import com.coocaa.app.lib.cleaner.mgr.DataHolder;

import java.util.List;

/**
 * Created by lu on 17-4-13.
 */

public class PackageDataDeleterFactory {//extends AbstractFactory<PackageDataDeleterImpl2> {

    /**
     * Created by lu on 17-4-13.
     */

    public interface PackageDataDeleter extends AbstractDeleter {
        interface PackageDataDeleterListener {
            void onPackageDataDeleterAllStart();

            void onPackageDataDeleterStart(String packageName);

            void onPackageDataDeleterEnd(String packageName, boolean result, long size);

            void onPackageDataDeleterAllEnd();
        }

        void delete(Context context, DataHolder.SinglePackageData data, PackageDataDeleterListener listener);

        void delete(Context context, List<DataHolder.SinglePackageData> datas, PackageDataDeleterListener listener);
    }


    public static final PackageDataDeleterFactory factory = new PackageDataDeleterFactory();


    private PackageDataDeleterImpl2 instance = null;

    public PackageDataDeleterImpl2 create() {
        return new PackageDataDeleterImpl2();
    }

    public synchronized PackageDataDeleterImpl2 instance() {
        if (instance == null)
            instance = create();
        return instance;
    }
}
